<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=1.0, user-scalable=no" />
	<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
	<link rel="Stylesheet" href="css/bootstrap-responsive.min.css" />
	<link rel="stylesheet" href="css/questudy.css" />
	
	<script src="http://code.jquery.com/jquery.js"></script>
	<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
	<script src="js/joinus/checkIdDup.js"></script>
<title>아이디 중복체크</title>
<%
	String memid = (String)request.getAttribute("memid");
	//boolean isFirst = true;
	boolean check = false;
	if(request.getAttribute("check") != null) {
		check = (request.getAttribute("check")).equals(Boolean.TRUE);	
	}
	if(memid == null)
		memid = "";
%>
</head>
<body>
	<form name="checkIdDuplication" method="get" action="IDCheckAction.Member" >
		<div class="container" >
			<div class="input-group">
			  <span class="input-group-addon">ID</span>
		      <input type="text" id="memid" name="memid" class="form-control" value='<%= memid %>'>
		      <span class="input-group-btn">
		        <button class="btn btn-default" type="button" onclick="idCheck()">중복체크</button>
		      </span>
		    </div>
		    <div>
		    	<p class="text-center">
		    		<br>
		    		<%
		    			if(check) { %>
				    		<button class="btn btn-default" type="button" onclick="useId('<%= memid %>')">ID 사용</button>
		    			<%}
		    		%>
		    	</p>
		    	<p class="text-center" id="message" >
		    	<%=memid %>
		    		<%if(!memid.equals("")) {%>
			    		<%if(check) { %>
			    			사용 가능한 ID 입니다
			    		<%} else {%>
			    			사용 불가능한 ID 입니다
			    		<%} %>
		    		<%} %>
		    	</p>
		    </div>
	    </div>
	</form>
</body>
</html>